/*
 * All rights Reserved, Designed By DataDriver
 * Copyright:    DataDriver.Inc
 * Company:      Zhuo Wo Infomation Technology (ShangHai) CO.LTD
 */
package com.sun.service;

import com.sun.config.MyEventPulish;
import org.springframework.context.ApplicationEvent;
import org.springframework.context.event.EventListener;
import org.springframework.stereotype.Service;

/**
 * 接受发布的事件
 */
@Service
public class EventService {

    @EventListener(MyEventPulish.class)
    public void receiveEvent(MyEventPulish event) {
        System.out.println("收到的事件名为:" + event.getUserName());
    }

}
